﻿
@{
    ViewBag.Title = Resources.WebStringsWeb.WebTitle;
    Layout = "~/Views/Shared/_LayoutMobile.cshtml";
}


@section css {
    <link href="~/Assets/css/searchmodal.css" rel="stylesheet" />
    <link href="~/Assets/css/mui.picker.min.css" rel="stylesheet" />
    <script src="~/Assets/js/mui.picker.js"></script>
    <script src="~/Assets/js/mui.picker.min.js"></script>
    <script src="~/Assets/js/mui.dtpicker.js"></script>
    <style>
        .IsException {
            color: red;
        }

        .IsNormal {
            color: blue;
        }

        .mui-bar ~ .mui-content .mui-scroll-wrapper {
            top: 44px;
            height: auto;
        }
    </style>
}
<div ng-cloak ng-controller="CheckFormController" ng-init="IsShowChoosePlace=false;GetSuperviseCheckType();
     AddModel = {};

     AddModel.FormNo = 'C'+'@DateTime.Now.ToString("yyMMddHHmmssfff")';
     AddModel.CheckTime='@DateTime.Now.ToString("yyyy-MM-dd")';
     ImageCount = [0,1,2];
     CheckItems=[];
     FileList = [];
     ">
    <header class="mui-bar mui-bar-nav">
        <a href="MSupervisionInspectionList" class="mui-icon mui-icon-left-nav mui-pull-left"></a>
        <a ng-tap="ScanPlaceCode();" class="mui-icon-extra mui-icon-extra-sweep mui-pull-right" style="margin-right: -10px; margin-top: 10px; padding-right: 10px; padding-left: 10px;"></a>
        <h1 class="mui-title" style="color:white;">安全监督检查</h1>
    </header>
    <div class="mui-content">
        <p ng-show="PlaceId==null" style="margin:20px;font-size:16px;">暂未选择任何场所...</p>
        <form class="mui-input-group" ng-show="PlaceId!=null">
            <div class="mui-input-row">
                <label>部门</label>
                <input type="text" ng-model="AddModel.DepartmentName" readonly />
            </div>
            <div class="mui-input-row">
                <label>部位名称</label>
                <input type="text" ng-model="PlaceName" readonly />
            </div>
            <div class="mui-input-row">
                <label>部门负责人</label>
                <input type="text" ng-model="AddModel.Manager" readonly />
            </div>
            <div class="mui-input-row">
                <label>责任人</label>
                <input type="text" ng-model="AddModel.ResponsibleName" readonly>
            </div>
            <div class="mui-input-row">
                <label>检查日期</label>
                <input type="text" ng-model="AddModel.CheckTime" readonly>
            </div>
            <div class="mui-input-row">
                <label>检查类型</label>
                <select ng-model="AddModel.CheckType" ng-change="GetCheckItemList(RoomId,AddModel.CheckType)">
                    <option ng-repeat="x in CheckTypeList" value="{{x.Id}}">{{x.IntervalName}}</option>
                </select>
            </div>
            <div class="mui-input-row">
                <label>检查人</label>
                <input type="text" ng-model="User.UserName" readonly>
            </div>
        </form>
        <div class="mui-card" ng-show="AddModel.CheckType!=null&&PlaceId!=null">
            <ul class="mui-table-view">
                <li ng-show="CheckItemList==null || CheckItemList.length==0">
                    <span style="color:red;">暂未分配检查任务</span>
                </li>
                <li class="mui-table-view-cell mui-collapse" ng-repeat="x in CheckItemList">
                    <a ng-init="CheckItems[$index].SortBy=x.SortBy" class="mui-navigate-right" style="white-space:unset;">
                        {{$index+1}}.{{x.CheckContent}}<span ng-show="x.IsValue && (CheckItems[$index].DataValue==null||CheckItems[$index].DataValue=='')" style="color:red;">(请输入测量值)</span><br />
                        <span ng-show="CheckItems[$index].Result==1" style="color:green;font-weight:bold;">正常</span><span ng-show="CheckItems[$index].Result==0" style="color: red; font-weight: bold;">异常</span>
                    </a>
                    <div class="mui-collapse-content" ng-init="CheckItems[$index].OptionId=x.OptionId">
                        <form class="mui-input-group" ng-init="CheckItems[$index].Result=1">
                            <div class="mui-input-row" ng-show="x.IsValue">
                                <label>&nbsp;&nbsp;测量值<span style="color:red">*</span></label>
                                <input type="text" ng-model="CheckItems[$index].DataValue" placeholder="测量值">
                            </div>
                            <div class="mui-input-row mui-radio mui-left">
                                <label>正常</label>
                                <input name="radio1" type="radio" ng-click="CheckItems[$index].Result=1" checked="checked">
                            </div>
                            <div class="mui-input-row mui-radio mui-left">
                                <label>异常</label>
                                <input name="radio1" ng-click="CheckItems[$index].Result=0" type="radio">
                            </div>

                            <div class="mui-input-row">
                                <label>&nbsp;&nbsp;&nbsp;&nbsp;备注</label>
                                <input type="text" ng-model="CheckItems[$index].Remark" placeholder="此处输入备注">
                            </div>
                        </form>
                        <p style="margin-top:30px;">上传照片（总大小在10M以下）</p>
                        <div class="row image-list" style="margin-top:20px;">
                            <img class="image-item space" src="../../Assets/img/upload.png" style="width:55px;height:auto;margin:5px;" ng-repeat="y in ImageCount" id="imagebox-{{x.OptionId}}_{{y}}" ng-click="InitLxImgUpload('imagebox-',x.OptionId,y)"/>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
        <div class="mui-button-row" style="margin-bottom:80px;">
            @*<button type="button" ng-click="MSaveCheckForm(0,AddModel,CheckItems,FileList);" ng-disabled="Loading" class="mui-btn mui-btn-primary mui-btn-block mui-btn-outlined">保 &nbsp;&nbsp;存</button>*@
            <button type="button" ng-show="CheckItemList.length>0" ng-click="MSaveSupInspectionForm(1,AddModel,CheckItems,FileList);" ng-disabled="Loading" class="mui-btn mui-btn-primary mui-btn-block">提 &nbsp;&nbsp;交</button>
        </div>
    </div>
 
    <div id="menu-backdrop" class="menu-backdrop"></div>
</div>

@section js{
    <script src="~/Assets/js/base/app-jssdk.umd.min.js"></script>
    <script src="~/Assets/js/libs/upload.js"></script>
    <script src="~/Assets/js/pg/MCheckForm.js?v=@DateTime.Now.ToString("yyyyMMddHHmm")"></script>
    <script>
        mui.init({
            swipeBack: false,
            keyEventBind: {
                backbutton: false  //关闭back按键监听
            }
        });
      


    </script>
}


